<template>
  <div :class="[ ...classes , 'titletime']" :style="styleses">
    <div style="display: inline-block;text-align: left;">
      <span style="color:#FFFFFF;">{{numstr}}</span>
      <br />
      <span>
        <span class="top_runningDay" style="color:#53F3F3;font-weight:bold;">{{numval}}</span> 天
      </span>
    </div>
  </div>
</template>
<script>
import axios from "@/utils/requestzz";;

import dayjs from 'dayjs'



import titlemixins from "@/mixins/bigScreen/titlemixins";
export default {
  mixins: [titlemixins],
  name: "tianshunum",
  components: {},
  data() {
    return {
      numval: "-",
      numstr: '供热运行天数'
    };
  },
  computed: {},
  watch: {
    "$store.state.daping.bigScreen": {
      handler: function(n, o) {
        // let n_tmp = n;
        // let g_bigscreen_data_arr = n_tmp.filter(item => {
        //   if (item.attrName == "start_date") {
        //     return true;
        //   }
        // });

        // let g_bigscreen_data = g_bigscreen_data_arr[0];

        // if (g_bigscreen_data_arr.length != 1) {
        //   return;
        // }
        // var g_running_start_date = Date.parse(
        //   g_bigscreen_data_arr.length == 1
        //     ? g_bigscreen_data_arr[0].attrValue
        //     : "2019-11-5"
        // );
        // var day = parseInt(
        //   (Date.parse(new Date()) - g_running_start_date) /
        //     (1000 * 60 * 60 * 24)
        // );
        // if (day >= 0) {
        //   this.numval = day;
        // }
      }
    }
  },
  mounted() {
    let days = dayjs().diff(dayjs('2020-11-15'),'day')
    if (days < 0) {
      this.numval = -days
      this.numstr = '供热倒计时'
    }
  },
  methods: {}
};
</script>
<style lang='scss' scoped>
</style>